package com.taotao.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.taotao.common.pojo.EUDataGridResult;
import com.taotao.common.pojo.TaotaoResult;
import com.taotao.pojo.TbContent;
import com.taotao.service.ContentService;

/***
 * 内容管理
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/content")
public class ContentController {
 
	@Autowired
	private ContentService contentService;
	
	/**
	 *  商品列表查询
	 * @param page
	 * @param rows
	 * @param categoryId
	 * @return
	 */
	@RequestMapping("/query/list")
    @ResponseBody
    public EUDataGridResult getContentList(Integer page, Integer rows,Long categoryId) {
		EUDataGridResult resultList = contentService.getContentList(page, rows, categoryId);
		return resultList;
	}
	
	/***
	 *  商品内容添加
	 * @param content
	 * @return
	 */
	@RequestMapping("/save")
	@ResponseBody
	public TaotaoResult insertContent(TbContent content) {
		TaotaoResult result = contentService.insertContent(content);
		return result;
	}

}
